package day1803;

public class danli {//饿汉式单例，没有任何安全隐患//缺点，一直占用内存

    private danli() {
    }

    static private danli a = new danli();//静态只能调用静态资源，所以修饰成静态

    public static danli getdanli(){//无法通过对象调用，修饰成静态，通过类名直接调用
        return a;
    }

    private String name = "赵子龙";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
